<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class Consume extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;
    protected $fillable = [
        'user_id',
        'mps_id',
        'video_id',
        'sort',
        'price',
        'status'
    ];

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }

    public function episode()
    {
        return $this->hasOne(Episode::class, 'id', 'video_id');
    }

    public function mps()
    {
        return $this->belongsTo(Mp::class, 'mps_id', 'id');
    }
    }
